\doxysection{bsp\+\_\+log.\+h}
\hypertarget{bsp__log_8h_source}{}\label{bsp__log_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/bsp/log/bsp\_log.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/bsp/log/bsp\_log.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ \_BSP\_LOG\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ \_BSP\_LOG\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}SEGGER\_RTT.h"{}}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}SEGGER\_RTT\_Conf.h"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#define\ BUFFER\_INDEX\ 0}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00014\ \textcolor{keywordtype}{void}\ BSPLogInit();}
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#define\ LOG\_PROTO(type,\ color,\ format,\ ...)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ SEGGER\_RTT\_printf(BUFFER\_INDEX,\ "{}\ \ \%s\%s"{}\ format\ "{}\(\backslash\)r\(\backslash\)n\%s"{},\ \(\backslash\)}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ type,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\#\_\_VA\_ARGS\_\_,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RTT\_CTRL\_RESET)}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/下面是日志输出的接口-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \textcolor{comment}{/*\ 清屏\ */}}
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#define\ LOG\_CLEAR()\ SEGGER\_RTT\_WriteString(0,\ "{}\ \ "{}\ RTT\_CTRL\_CLEAR)}}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \textcolor{comment}{/*\ 无颜色日志输出\ */}}
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#define\ LOG(format,\ ...)\ LOG\_PROTO("{}"{},\ "{}"{},\ format,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00040\ \textcolor{preprocessor}{\#if\ DISABLE\_LOG\_SYSTEM}}
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#define\ LOGINFO(format,\ ...)\ }}
\DoxyCodeLine{00042\ \textcolor{preprocessor}{\#define\ LOGWARNING(format,\ ...)\ }}
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#define\ LOGERROR(format,\ ...)\ }}
\DoxyCodeLine{00044\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00045\ \textcolor{comment}{//\ information\ level}}
\DoxyCodeLine{00046\ \textcolor{preprocessor}{\#define\ LOGINFO(format,\ ...)\ LOG\_PROTO("{}I:"{},\ RTT\_CTRL\_TEXT\_BRIGHT\_GREEN,\ format,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{00047\ \textcolor{comment}{//\ warning\ level}}
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#define\ LOGWARNING(format,\ ...)\ LOG\_PROTO("{}W:"{},\ RTT\_CTRL\_TEXT\_BRIGHT\_YELLOW,\ format,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{00049\ \textcolor{comment}{//\ error\ level}}
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#define\ LOGERROR(format,\ ...)\ LOG\_PROTO("{}E:"{},\ RTT\_CTRL\_TEXT\_BRIGHT\_RED,\ format,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \ DISABLE\_LOG\_SYSTEM}}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00061\ \textcolor{keywordtype}{int}\ PrintLog(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *fmt,\ ...);}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00070\ \textcolor{keywordtype}{void}\ Float2Str(\textcolor{keywordtype}{char}\ *str,\ \textcolor{keywordtype}{float}\ va);}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
